{extend name="public/base"/}
{block name="body"}
<link rel="stylesheet" type="text/css" href="/static/css/boxImg.css">
<style type="text/css">
	.attrs{margin-top:5px;}
	.attrname{width:100px;border:solid 1px #ddd;height:31px;font-size:14px;padding-left:4px;}
	.attrval{width:40%;border:solid 1px #ddd;height:31px;font-size:14px;padding-left:4px;}
	.status{width:60px;height:60px;background-color:#dddddd;border-radius:30px;float:left;text-align: center;margin-right:10px;}
	.status p{font-size:10px;color:#ffffff;margin-bottom:0;}
	.status p:first-child{margin-top:10px;}
	.active{background-color:#2eb51c !important;}
</style>
<title>详情</title>
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
		<input type="hidden" class="input-text" value="{$data.id}" id="id" name="id">
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.title}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">图片：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<img modal="zoomImg" style="width:25%" src="{$data.img}">
			</div>
		</div>
		{if $data.order_type==1}
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">规格参数：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.combination}
			</div>
		</div>
		{/if}
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">单价：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.price}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">购买量：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.buy_num}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">佣金抵扣：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.deduct_money}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">支付费用：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.pay_fee}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.name}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">电话：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.phone}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.address}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">订单号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.ordernosub}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">状态：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{if $data.state==1}
				待付款
				{elseif $data.state==2}
				待发货
				{elseif $data.state=3}
				待收货
				{elseif $data.state==4}
				已完成
				{elseif $data.state==5}
				{elseif $data.state==6}
				已取消
				{/if}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">下单时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{:date('Y-m-d H:i:s',$data.time)}
			</div>
		</div>

		{if $data.fktime}
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">付款时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{:date('Y-m-d H:i:s',$data.fktime)}
			</div>
		</div>
		{/if}

		{if $data.fhtime}
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">发货时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{:date('Y-m-d H:i:s',$data.fhtime)}
			</div>
		</div>
		{/if}

		{if $data.order_type==1}
			{if $data.state==2}
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">快递公司：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="{$data.express_company}" placeholder="快递公司" id="express_company" name="express_company">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">快递单号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="{$data.express_no}" placeholder="快递单号" id="express_no" name="express_no">
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
						<input id="submit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;发货&nbsp;&nbsp;">
					</div>
				</div>
			{else}
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">快递公司：</label>
					<div class="formControls col-xs-8 col-sm-9">
						{$data.express_company}
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">快递单号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						{$data.express_no}
					</div>
				</div>
			{/if}
		{/if}

	</form>
</article>


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="/static/js/boxImg.js"></script>
<script type="text/javascript">
$("#submit").click(function() {
	layer.load(1, {
	  shade: [0.1,'#fff'] //0.1透明度的白色背景
	});
	var id=$("input[name=id]").val();
	var express_company=$("input[name=express_company]").val();
	var express_no=$("input[name=express_no]").val();
    $.ajax({
	    type: 'POST',
	    url: "{:url('orders_detail')}",
	    data: {id:id,express_company:express_company,express_no:express_no},
	    success: function(resdata){
	        if(resdata.code==200){
				layer.msg(resdata.msg,{icon:1,time:1000});
				setTimeout("parent.location.reload()",1000);
	        }else{
				layer.msg(resdata.msg,{icon:2,time:3000});
	        }
	    },
	    error: function(){
			layer.msg('数据保存失败',{icon:2,time:3000});
	    }
	})
})
</script> 
{/block}